<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport"
	content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<title>修改地址</title>
<link href="css/style2zc.css" rel="stylesheet" type="text/css">
<link href="css/type.css" rel="stylesheet" type="text/css">
<style type="text/css">
/*<![CDATA[*/
* html .decoration {
	position: absolute;
	right: 16px;
	top: 0;
} /*only for ie*/
/*]]>*/
.newaddr_data input{
	text-align: center;
	font-size: 16px;
	color:#a0a0a0;
	line-height:16px;
	font-family:"Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu;
}
</style>
<!-- Do not move the bellow script to custom.js! It must stay here to
    load properly! -->
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/jquerysession.js"></script>
<script type="text/javascript" src="scripts/custom2zc.js" charset="utf-8"></script>
<script type="text/javascript" src="scripts/layer/layer.m.js"></script>
</head>
<body onLoad="loadImages()">
	<p class="no-mobile">
		请使用手机访问本页面！ <br /> 这个页面是专门针对手机设计的！
	</p>
	<div class="site">
		<div id="hidepage">
			<p class="center-text">
				加载中，请耐心等待! <br /> <img src="images/background/130.gif"
					alt="load">
			</p>
		</div>
	<div class="decoration">
		<div class="back">
			<a href="javascript:history.back(-1)">
				<img src="images/home/back.png">
			</a>
		</div> 
		<p class="title" style="width: 33%;float: left;">修改地址</p>
		<div style="width: 33%">
		</div> 
	</div>
	<div id="wrapper">
		<form action="transaction2zcRouter?funcID=0034" method="post" id="editFrom">
		<input name="id" type="hidden"  value="${addr.id}">
		<input name="areaId" type="hidden"  value="${addr.areaId}">
		<input name="def" id="def" type="hidden"  value="${addr.def}">
		<div class="new_addr">
			<div class="person_basemsg" id="row">
				<div class="addr_row">
					<div class="newaddr_title">联系姓名</div>
					<div class="newaddr_data">
					<input name="userName"  id="userName" maxlength="10" type="text" style="width: 100%;float: left;color: black;" value="${addr.userName}">
					</div>
				</div>
				<div class="addr_row">
					<div class="newaddr_title">联系电话</div>
					<div class="newaddr_data">
					<input name="userMp" id="userMp" maxlength="11" type="text" style="width: 100%;float: left;;color: black;" value="${addr.userMp}">
					</div>
				</div>
			</div>
			<div class="area_addr" id="row">
				<div class="addr_row">
					<div class="newaddr_title">地标地址</div>
					<div class="newaddr_data">
					<input type="text" style="width:100%;float: left;" readonly="readonly" name="area" value="${addr.area}" >
					</div>
				</div>
				<div class="addr_row">
					<div class="newaddr_title">取餐地址</div>
					<div class="newaddr_data">
					<input type="text" style="width:100%;color: black;" name="address" id="address" value="${addr.address}" >
					</div>
				</div>
			</div>
			<div class="newaddr_btn">
				<a href="javascript:void(0)"  onclick="setDef()">
					<img src="images/person/default_address.png">
				</a>
			</div>
			<div class="newaddr_btn1">
				<a href="javascript:void(0)" onclick="edit()">
					<img src="images/home/complete.png">
				</a>
			</div>
		</div>
		</form>
	</div>
	</div>
	<script type="text/javascript">
		/* $(document).ready(function () {
			 javascript:window.history.forward(-1); 
		 }); */
		
		function edit(){
			var userName=$("#userName").val();
			var userMp=$("#userMp").val();
			var address=$("#address").val();
			if(userName==""){
				 layer.open({content: '请输入姓名！',time: 2}); 
				 return;
			}
			if(userMp==""){
				 layer.open({content: '请输入手机号！',time: 2});
				 return;
			}
			if(!validateMobileNum(userMp)){
				layer.open({content: '手机号码格式错误！',time: 2}); 
				return;
			}
			if(address==""){
				 layer.open({content: '请输取餐地址！',time: 2});
				 return;
			}
			window.history.forward(1);
			$("#editFrom").submit();
		}
		function setDef(){
			$("#def").val("1");
			layer.open({content: '设置默认地址成功！',time: 2});
		}
	</script>
</body>
</html>